Not applicable
1. Field of the Invention
The invention disclosed broadly relates to the field of computer software development and more particularly relates to the field of software toolkits for application development for applications performing database queries.
2. Description of the Related Art
The number of web-based software applications that use database queries continues to grow as more information becomes available through the Internet and the World Wide Web. One example of a Web based program using database queries is the online or electronic Yellow pages application that is described in the patent application Ser. No. 09/061,387, filed Jan. 30, 1998, for xe2x80x9cExtensible Method And Apparatus For Retrieving File Names During Program Executionxe2x80x9d by Joseph Celi, Jr. and Wendi L. Nusbickel, commonly assigned herewith to International Business Machines Corporation (IBM) now U.S. Pat. No. 6,119,133. The electronic Yellow Pages are Online or Web-based directory listings are the electronic or online analogues to their familiar, traditional paper counterparts Traditional paper telephone directory listings like the White Pages, Yellow Pages and industry specific directory listings have been around for decades. These online directory services are expanding beyond providing simply name, address and telephone information and have begun to offer E-Mail directory listings, Web page address listings, fax directory listings, maps of the business location, additional information in a multimedia format about the business listing and much more.
Computer applications such as online directory services use database retrieval techniques to present data to users. These classes of applications are often referred to as xe2x80x9cdata drivenxe2x80x9d because the exact display of the data on the computer screen is not known until runtime. Typically, these applications provide information in response to a user request by filling-in fixed data fields in a presentation screen with data retrieved from a database. In the online directory listing example data fields are filled-in with data stored in a database. The data includes residential name or business name, address and telephone number. Optional data fields such as zip code may also be included, and like their paper counterpart, online Yellow Page applications permit customized advertisement to be displayed with a directory listing. However, the online Yellow Page applications expand beyond these basic print advertisements to include multimedia advertisements that may relate to the listing. The customized multimedia advertisement may be related to the specific directory listing or a regional advertisement or an advertisement related to some other feature. One example of additional data that may be displayed in relation to a specific directory query is a street-map. An example street mapping example can be found at the online URL http://www.yahoo.com under the link xe2x80x9cmaps.xe2x80x9d A challenge for programmers and software designers is providing the correct regional map and related data, such as advertisement, for each user request. Software designers typically use relational databases to organize data such as images files of regional maps. The use of databases allows images of regional maps and other data to be indexed in an organized manner in order to be retrieved with a given user query. Database records comprising a series of database elements are designed to hold two fields, a first field designated to hold the names of image files, such as images of street maps, and a second field to hold the names of data files. The use of filenames for the image file or data file permits the database entries to remain unchanged and at the same time enables the updating of the contents of the files themselves This combination of a relational database with filename entries, enables fast, efficient retrieval of images and related data that may be stored locally or remotely via a network.
While the use of a data driven program via database servers is increasing, they are not without their shortcomings. Like most providers of software applications, providers of Web-based, Intranet, Internet, and client server type applications have a need to demonstrate their software programs to prospective customers and users. However, demonstrating software products that depend on databases running on a server can be a problem. In order to demonstrate querying to a database, the application must be actively connected to the database. Many times this can be inconvenient, especially for demonstrations on the road where a sales person is using a laptop PC to demonstrate the software product. Some sales persons use a local copy of a database running on a client PC, however, the size of larger databases can make this impractical for many applications because the database can not physically fit on the disk space in a laptop PC. Accordingly, a need exists to enables providers of data driven applications performing database queries a method to demonstrate an application without being connected to a database.
Today, many data driven programs that use database information are written in a programming language known as Java. Java is a programming language developed by Sun Microsystems. A basic idea behind Java programming is that the same Java software code can run on many different kinds of computers. Stated differently, the goal of Java is to write software once to be run on any Java compliant platform. These different platforms include both different hardware platforms, e.g., RISC, PC, Macintosh, Sparc and different operating system platforms, e.g., Windows 95/NT, Unix, AIX, and Copeland. These platforms cover a large class of completely different machines from large servers to thin clients to small portable consumer devices such as personal digital assistants. Software programming tools are available from a variety of suppliers including Sun Microsystems (refer to online URL www.sun.com/java) for developing Java-based software applications, or more simply called Java Applications.
During the development of Java, the Internet, and more particular the World Wide Web (xe2x80x9cWebxe2x80x9d) has become immensely popular largely because of the ease of finding information and the user-friendliness of today""s browsers. A feature known as hypertext allows a user to access information from one Web page to another Web page by simply pointing (using a pointing device such as a mouse) at the hypertext and clicking. Another feature that makes the Web attractive is having the ability to process the information (or content) in remote Web pages without the requirement of having a specialized application program for each kind of content accessed. Thus, the same content is viewed across different platforms. Browser technology has evolved to enable running of applications that manipulate this content across a wide variety of different platforms.
In 1995, Sun Microsystems formally introduced HotJava. HotJava is a Web browser that can run Java code. Other Web browsers such as Netscape Navigator and Microsoft Internet Explorer have since added Java capability to their base Web browser products. The combination of Web browser technology combined with Java technology has increased the fundamental of appeal of Java, i.e., the ability to write an application once and run the application across a variety of platforms including Web browsers, and while most of the Java code is portable across platforms, including Java-compliant Web browsers, some functions such as returning handles to frames or the handling of Input/Output (I/O)are not compatible across platforms. Two categories of Java-based programs are necessary. The first category of Java base programs is called a Java Application that runs across computer platforms without being combined with a Web browser. The second category of Java-based programs is called Java Applets that run across systems using Java compliant Web browsers. The reason many functions are not compatible across Java runtime environments of Applets and Applications is due to security concerns. Java Applets are typically loaded by a Web browser being accessed. The Applet by design cannot write to or read from local storage devices. This deliberate limitation for I/O is designed to minimize the destructive use of Java Applets as computer viruses that unknowingly make changes to the compute system of the end user. A Java Applet with local write and read access could easily create havoc by deleting, renaming, scrambling and otherwise corrupting a user computer system.
Both of these categories of Java-based programs, Java Application and Java Applets require specialized I/O handling. Providers of Java Applications and Java Applets that perform database queries want to demonstrate an application without the need to be connected to a database. Accordingly, there is a need for a method to provide an I/O class interface that can be used both by Java Applications and Java Applets which provides a method to demonstrate Java-based code that performs database queries without being connected to a database.
Furthermore, providers of applications often want to demonstrate network connectivity using a Java Applet or Java Application communicating to a server, but not perform database calls on the server during the demonstration. The desire not to interface to a database during a demonstration may be based on a variety of reasons, such as, limiting the access to a database over the Internet for security concerns, minimizing the performance hits to a database running a live application while demonstrating the code, or simple the complexity of having a database up and running during the initial phases of a sales cycle. Accordingly, a need exists to provide a method to demonstrate Java-based applications that can demonstrate network connectivity using a browser with out the requirement of performing database queries when demonstrating database driven applications.
Briefly, in accordance with the present invention, a method to retrieve data in a information processing unit comprises: creating a pointer into a database based on a category of data to be retrieved, determining if an application running on the information processing unit is running in an online mode where the information processing unit is coupled to a database server or if the application is running in an offline mode where the information processing unit is not coupled to the database server; and retrieving at least part of the data using the pointer to the database when the application is running in an online mode. In accordance with another aspect of the invention, a computer readable medium can include instructions to program data processing apparatus to carry out the above method.